home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / CHIP Turkiye Ekim 2000.iso / prog / naps / 04 / setup.exe / Gnucleus / GnuTransfer.h < prev    next >
C/C++ Source or Header  |  2000-06-24  |  2KB  |  100 lines

  1. #if !defined(AFX_GNUTRANSFER_H__3C289740_2843_11D4_ACF2_00A0CC533D52__INCLUDED_)
  2. #define AFX_GNUTRANSFER_H__3C289740_2843_11D4_ACF2_00A0CC533D52__INCLUDED_
  3.  
  4. #if _MSC_VER > 1000
  5. #pragma once
  6. #endif // _MSC_VER > 1000
  7. // GnuTransfer.h : header file
  8. //
  9.  
  10.  
  11.  
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CGnuTransfer command target
  14.  
  15. // Seperate thread
  16. class CGnuTransfer : public CAsyncSocket
  17. {
  18.     DECLARE_DYNCREATE(CGnuTransfer)
  19.  
  20. // Attributes
  21. public:
  22.     int     Handle;
  23.     CString Status;
  24.     char    Type;
  25.     bool    IsTransfering;
  26.     CString ClientName;
  27.  
  28.     CFile File;
  29.     DWORD FileSize;
  30.     QueryItem FileInfo;
  31.  
  32.     DWORD BytesCompleted;
  33.     DWORD OldBytesCompleted;
  34.     float OldRate;
  35.  
  36.     DWORD AllocBw;
  37.  
  38.     CGnuControl *GnuComm;
  39.  
  40. // Operations
  41. public:
  42.     CGnuTransfer();
  43.     CGnuTransfer(CGnuControl *);
  44.     virtual ~CGnuTransfer();
  45.  
  46.     static void SendFile(void *);
  47.  
  48.     void Pause();
  49.     void Resume();
  50.  
  51.     void   StartSending();
  52.     bool   IsFileOpen;
  53.     HANDLE m_threadHandle;
  54.  
  55.     // Link to next CGnuTransfer node in the list
  56.     CGnuTransfer *next;
  57.  
  58. // Overrides
  59. public:
  60.     DWORD m_dwBytesIn;        // for one period only
  61.     DWORD m_dwBytesOut;        // for one period only
  62.     DWORD m_dwTotalBytesIn;
  63.     DWORD m_dwTotalBytesOut;
  64.     DWORD m_dwByteAllottmentOut;
  65.     DWORD m_dwByteAllottmentIn;
  66.     DWORD GetSecondsSinceLastContact(void)    
  67.         {return ( CTime::GetCurrentTime() - m_timeLastHeardAT ).GetTotalSeconds();}
  68.     
  69.     // ClassWizard generated virtual function overrides
  70.     //{{AFX_VIRTUAL(CGnuTransfer)
  71.     public:
  72.     virtual void OnConnect(int nErrorCode);
  73.     virtual void OnReceive(int nErrorCode);
  74.     virtual void OnClose(int nErrorCode);
  75.     //}}AFX_VIRTUAL
  76.  
  77.     // Generated message map functions
  78.     //{{AFX_MSG(CGnuTransfer)
  79.         // NOTE - the ClassWizard will add and remove member functions here.
  80.     //}}AFX_MSG
  81.  
  82. // Implementation
  83. protected:
  84.     void WantToDisconnect();
  85.     Initialize();
  86.     
  87.     CWinThread *SendFileThread;
  88.  
  89.     CTime        m_timeLastHeardAT;        // hold time of last contact, for expiring non responding hosts.
  90. };
  91.  
  92.  
  93.  
  94. /////////////////////////////////////////////////////////////////////////////
  95.  
  96. //{{AFX_INSERT_LOCATION}}
  97. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  98.  
  99. #endif // !defined(AFX_GNUTRANSFER_H__3C289740_2843_11D4_ACF2_00A0CC533D52__INCLUDED_)
  100.